/**
 * Copyright (C) 2017 - 2020 https://github.com/joewee
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.bifrost.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author joewee
 * @version 1.0.0
 * @Date 2017/11/6 15:17
 */
@Entity
@Table(name = "SCHEDULE_JOB_LOG")
@NamedQuery(name = "ScheduleJobLog.findAll", query = "SELECT a FROM ScheduleJobLog a")
public class ScheduleJobLog implements Serializable {
    private static final long serialVersionUID = -2052931158559027925L;
    /**
     * 日志id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "ID", unique = true, nullable = false)
    private Long id;

    /**
     * 任务id
     */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "JOB_ID")
    private ScheduleJob job;

    /**
     * spring bean名称
     */
    @Column(name = "BEAN_NAME")
    private String beanName;

    /**
     * 方法名
     */
    @Column(name = "METHOD_NAME")
    private String methodName;

    /**
     * 参数
     */
    @Column(name = "PARAMS")
    private String params;

    /**
     * 任务状态    0：成功    1：失败
     */
    @Column(name = "STATUS")
    private String status;

    /**
     * 失败信息
     */
    @Column(name = "ERROR")
    private String error;

    /**
     * 耗时(单位：毫秒)
     */
    @Column(name = "TIMES")
    private Integer times;

    /**
     * 创建时间
     */
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "CREATE_TIME")
    private Date createTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public ScheduleJob getJobId() {
        return job;
    }

    public void setJobId(ScheduleJob jobId) {
        this.job = jobId;
    }

    public String getBeanName() {
        return beanName;
    }

    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public String getParams() {
        return params;
    }

    public void setParams(String params) {
        this.params = params;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }

    public Integer getTimes() {
        return times;
    }

    public void setTimes(Integer times) {
        this.times = times;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
